<?php

namespace frame;

class Route
{
    public static function load()
    {
        $server = $_SERVER['PATH_INFO'];
        $server = explode('/',$server)[1];
        $conf = ROOT_PATH . 'config' . DS . 'route.php';
        $conf = include $conf;
        foreach ($conf as $k => $v) {
            if ($server == $k) {
                if ($v == '') {
                    $obj = new $conf[$k];
                } else {
                    $obj = new $v;
                    $obj->index();
                }
                die();
            }
        }
    }
}
